﻿/* 4. Write a program to print the numbers 1, 101 and 1001. */

// Add Reference to 'System.Numerics'.

using System;
using System.Numerics;

public class SomeNumbers
{
    private static int members = 3;
    private static byte firstMember = 1;

    public static void Main()
    {
        InputData();
        Print(SomeNumbers.firstMember, SomeNumbers.members);
        Console.WriteLine();
    }

    public static void Print(byte firstMember, int members)
    {
        BigInteger currentValueMinusOne = 100;

        Console.Write(firstMember);
        for (int i = 1; i < members; i++)
        {
            Console.Write(", {0}", currentValueMinusOne + firstMember);
            currentValueMinusOne *= 10;
        }
    }

    public static void InputData()
    {
        do
        {
            Console.Clear();
            Console.Write("Enter a digit for first member : ");
            if (byte.TryParse(Console.ReadLine(), out SomeNumbers.firstMember) == false)
                continue;

            if (SomeNumbers.firstMember <= 9)
                break;

        } while (true);

        do
        {
            Console.Clear();
            Console.Write("First member : {0}\nEnter natural number for number of members in sequence : ",
                            SomeNumbers.firstMember);
            if (int.TryParse(Console.ReadLine(), out SomeNumbers.members))
                if (SomeNumbers.members > 0)
                {
                    Console.Clear();
                    Console.WriteLine("First member : {0}\nNumber of members : {1}",
                                        SomeNumbers.firstMember, SomeNumbers.members);
                    break;
                }

        } while (true);
    }
}